﻿using System.Linq;
using System.Web.Mvc;
using QDT.Core.Domain.Enums;
using QDT.Web.Helper;

namespace QDT.Web.Controllers
{
    public partial class WidgetController
    {
//        [OutputCache(Duration = 600)]
        public PartialViewResult NoticeList() {
            var data = ArticleService.QueryLatestArticle(4);
            return ChildResult(data.ToNoticeModelList());
        }

//        [OutputCache(Duration = 600)]
        public PartialViewResult SingleNew()
        {
            var data = ArticleService.SingleNew();
            return ChildResult(data.ToNoticeModelList());
        }
//        [OutputCache(Duration = 600)]
        [ChildActionOnly]
        public PartialViewResult ArticleList(int size=6,string temp="") {
           
            var data = ArticleService.QueryList(1, size);

            var model = data.ToModelList();

            if (string.IsNullOrWhiteSpace(temp))
            {
                return PartialView(model);
            }

            return PartialView(temp, model);
        }

    }
}
